<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>系统登录 - 交易监控系统</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="icon" href="{{ url_for('static', path='img/favicon.ico') }}" type="image/x-icon">
    <link rel="shortcut icon" href="{{ url_for('static', path='img/favicon.ico') }}" type="image/x-icon">
    <style>
        :root {
            --primary-color: #165DFF;
            --dark-bg: #1a2035;
            --card-bg: #ffffff;
            --text-color: #333333;
            --light-text: #666666;
            --border-color: #e0e0e0;
            --success-color: #4CAF50;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
        }

        body {
            background: linear-gradient(135deg, var(--dark-bg) 0%, #2c3e50 100%);
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
            position: relative;
            overflow: hidden;
        }

        body::before {
            content: '';
            position: absolute;
            width: 600px;
            height: 600px;
            background: rgba(255, 255, 255, 0.05);
            border-radius: 50%;
            top: -200px;
            right: -200px;
            z-index: 0;
        }

        body::after {
            content: '';
            position: absolute;
            width: 400px;
            height: 400px;
            background: rgba(22, 93, 255, 0.1);
            border-radius: 50%;
            bottom: -150px;
            left: -150px;
            z-index: 0;
        }

        .login-container {
            width: 100%;
            max-width: 900px;
            display: flex;
            background: var(--card-bg);
            border-radius: 16px;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
            overflow: hidden;
            position: relative;
            z-index: 1;
        }

        .login-left {
            flex: 1;
            padding: 4rem;
            background: var(--primary-color);
            color: white;
            display: flex;
            flex-direction: column;
            justify-content: center;
            position: relative;
        }

        .login-left::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: url('') repeat;
            opacity: 0.2;
        }

        .login-left-content {
            position: relative;
            z-index: 1;
        }

        .login-left h1 {
            font-size: 2.5rem;
            margin-bottom: 1.5rem;
            font-weight: 700;
        }

        .login-left p {
            font-size: 1.1rem;
            opacity: 0.9;
            line-height: 1.6;
        }

        .login-features {
            margin-top: 3rem;
        }

        .feature-item {
            display: flex;
            align-items: center;
            margin-bottom: 1.5rem;
        }

        .feature-item i {
            font-size: 1.5rem;
            margin-right: 1rem;
            background: rgba(255, 255, 255, 0.2);
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .login-right {
            flex: 1;
            padding: 4rem;
        }

        .login-header {
            text-align: center;
            margin-bottom: 2.5rem;
        }

        .login-header h2 {
            font-size: 1.8rem;
            color: var(--text-color);
            margin-bottom: 0.5rem;
        }

        .login-header p {
            color: var(--light-text);
        }

        .login-form {
            margin-top: 2rem;
        }

        .form-group {
            margin-bottom: 1.5rem;
        }

        .form-label {
            display: block;
            margin-bottom: 0.75rem;
            font-weight: 500;
            color: var(--text-color);
        }

        .form-control {
            width: 100%;
            padding: 1rem 1.25rem;
            border: 1px solid var(--border-color);
            border-radius: 8px;
            font-size: 1rem;
            transition: all 0.3s ease;
            background: #f9fafb;
        }

        .form-control:focus {
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.1);
            outline: none;
            background: white;
        }

        .btn-primary {
            width: 100%;
            padding: 1rem;
            background: var(--primary-color);
            border: none;
            border-radius: 8px;
            color: white;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            margin-top: 1rem;
        }

        .btn-primary:hover {
            background: #0E42D2;
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(22, 93, 255, 0.2);
        }

        .alert-danger {
            padding: 1rem;
            background-color: #FFF5F5;
            border-left: 4px solid #FF4D4F;
            color: #F5222D;
            border-radius: 4px;
            margin-bottom: 1.5rem;
        }

        .form-footer {
            text-align: center;
            margin-top: 2rem;
            color: var(--light-text);
        }

        .form-footer a {
            color: var(--primary-color);
            text-decoration: none;
        }

        .form-footer a:hover {
            text-decoration: underline;
        }

        .footer-text {
            text-align: center;
            margin-top: 3rem;
            color: var(--light-text);
            font-size: 0.9rem;
        }

        @media (max-width: 768px) {
            .login-container {
                flex-direction: column;
            }

            .login-left, .login-right {
                padding: 2.5rem;
            }

            .login-left {
                order: -1;
            }
        }
    </style>
</head>
<body>
    <div class="login-container">
        <div class="login-left">
            <div class="login-left-content">
                <h1>交易监控系统</h1>
                <p>专业的交易监控与分析平台，为您的投资决策提供全方位支持与保障。</p>

                <div class="login-features">
                    <div class="feature-item">
                        <i class="fas fa-shield-alt"></i>
                        <div>
                            <h3>安全可靠</h3>
                            <p>多重加密保障您的交易数据安全</p>
                        </div>
                    </div>
                    <div class="feature-item">
                        <i class="fas fa-chart-line"></i>
                        <div>
                            <h3>实时监控</h3>
                            <p>实时追踪市场动态与交易状况</p>
                        </div>
                    </div>
                    <div class="feature-item">
                        <i class="fas fa-bolt"></i>
                        <div>
                            <h3>极速响应</h3>
                            <p>毫秒级数据处理与交易执行</p>
                        </div>
                    </div>
                    <div class="feature-item">
                        <i class="fas fa-cogs"></i>
                        <div>
                            <h3>算法交易</h3>
                            <p>算法交易，智能执行投资策略</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="login-right">
            <div class="login-header">
                <h2>欢迎回来</h2>
                <p>请输入您的账号信息登录系统</p>
            </div>
            <div class="login-form">
                {% if error %}
                <div class="alert-danger">
                    {{ error }}
                </div>
                {% endif %}
                <form method="post" action="/login">
                    <div class="form-group">
                        <label class="form-label fw-bold" for="username">用户名</label>
                        <input type="text" class="form-control" id="username" name="username" required autofocus>
                    </div>
                    <div class="form-group">
                        <label class="form-label fw-bold" for="password">密码</label>
                        <input type="password" class="form-control" id="password" name="password" required>
                        <button class="btn btn-link toggle-password mt-2 d-block" style="padding: 0.375rem 0.75rem; border: none;" type="button">
                            <i class="fas fa-eye"></i>
                        </button>
                    </div>
                    <script>
                        // 密码显示/隐藏切换
                        document.querySelector('.toggle-password').addEventListener('click', function() {
                            const passwordField = document.getElementById('password');
                            const icon = this.querySelector('i');
                            
                            if (passwordField.type === 'password') {
                                passwordField.type = 'text';
                                icon.classList.replace('fa-eye', 'fa-eye-slash');
                            } else {
                                passwordField.type = 'password';
                                icon.classList.replace('fa-eye-slash', 'fa-eye');
                            }
                        });
                    </script>
                    <button type="submit" class="btn-primary">登录</button>
                </form>
                <div class="form-footer">
                    <a href="/forgot-password">忘记密码?</a>
                </div>
                <div class="footer-text">
                    © 2025 交易监控系统
                </div>
            </div>
        </div>
    </div>
</body>
</html>